<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>左右固定-中间自适应</title>
    <style>
        /* 1、利用自身浮动 */
        .boxLeft{
            min-height: 100px;
            width: 200px;
            background: #987;
            float: left;
        }
        .boxRight{
            min-height: 100px;
            width: 300px;
            background: #369;
            float: right;
        }
        .boxCenter{
            min-height: 100px;
            margin-left: 220px;
            margin-right: 320px;
            background: #192;
        }
</style>
</head>
<body>
<h2>1、利用自身浮动</h2>
<p>左右浮动两块div元素，脱离标准流，中间那块元素就会上去，跟他们一行，利用margin留出左右宽度</p >
<div class=box1>
    <div class="boxLeft">左边</div>
    <div class="boxRight">右边</div>
    <!-- 注意这个div一定要放最下面 -->
    <div class="boxCenter">中间</div>
</div>

</body>
</html>